import java.util.Scanner; 
public class demo03{
    
    public static void main(String[] args){
        int n=0;
        int[] prime = new int [10000020];
        Scanner scanner = new Scanner(System.in);
        if(scanner.hasNextInt()){
            n = scanner.nextInt();
            fun f = new fun();
            f.get_prime(prime);
            System.out.println(prime[n-1]);
        }
    }
}
class fun{
    int cnt;
    boolean[] st = new boolean[179424822];
    public void get_prime(int[] prime){
         for (int i = 2; i <= 179424821; i ++ )
        {
            if (!st[i]) prime[cnt ++ ] = i;
            for (int j = 0; prime[j] <= 179424821 / i; j ++ )
            {
                st[prime[j] * i] = true;
                if (i % prime[j] == 0) break;
          }
        }
    }
}